<?php
namespace console\controllers;

use common\components\helpers\Fun;
use common\components\helpers\MsgeventData;
use common\components\services\msg\MsgSendManage;
use common\models\datas\MsgLog;
use common\models\datas\MsgTemplate;
use yii\db\Query;
use yii\helpers\Console;
use yii\console\Controller;

class MsgController extends Controller{

    public $eventKey;
    public $ownerArray;
    public $site_id;
    public $admin_id;

    public function actionSendclassmanage($query=''){
        if(empty($query)){
            return;
        }else{
            $query = unserialize(gzuncompress(base64_decode($query)));
            $object=\Yii::createObject(['class'=>MsgSendManage::className()]);
            foreach ($query->batch() as $msgs){
                foreach ($msgs as $msg){
                    $object->send($msg['id']);
                }
            }
        }
    }

}